home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Classes / PtrNumberLine / drawPointer.psw < prev    next >
Encoding:
Text File  |  1992-05-26  |  972 b   |  43 lines

  1. // By Judy D. Halchin, Educational Computing Services, Allegheny College.
  2. // You may freely copy, distribute and reuse this code. 
  3. // Allegheny College and the author disclaim any warranty of any kind, 
  4. // expressed or implied, as to its fitness for any particular use.
  5. // This work was partially supported by a Teacher Preparation grant from the 
  6. // National Science Foundation.
  7.  
  8. defineps drawPointer(float size)
  9.  
  10. gsave
  11. newpath
  12.  
  13. % white out the background
  14. 1 setgray
  15. 0 setalpha
  16. 0 0  size size  rectfill
  17.  
  18. 2 1  translate
  19. /height   size 3 sub   def
  20.  
  21. /twelfth    height 12 div    def
  22. /fourth     height 4  div    def
  23. /half       height 2  div    def
  24. /seventwelfths     twelfth 7 mul    def
  25. /fivetwelfths      twelfth 5 mul    def
  26.  
  27. fourth half  moveto
  28. half  height lineto
  29. fourth 3 mul   half  lineto
  30. seventwelfths half lineto
  31. seventwelfths 0 lineto
  32. fivetwelfths  0 lineto
  33. fivetwelfths half  lineto
  34. fourth half lineto
  35. 0 setgray
  36. 1 setalpha
  37. 2 setlinewidth
  38. stroke
  39.  
  40. grestore
  41.  
  42. endps
  43.